module.exports   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 29

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 29
rs 8.8571

4 Functions

Rating   Name   Duplication   Size   Complexity  
A 0 4 1
A 0 4 1
A 0 3 1
A 0 3 1
1
const cont = require('../controllers')
2
const CustomerController = cont.Customer
3
const PriceController = cont.Price
4
const MessageController = cont.Message
5
const AuthController = cont.Auth
6
const passportConfig = require('./passport')
0 ignored issues
show
Unused Code introduced by
The constant passportConfig seems to be never used. Consider removing it.
Loading history...
7
8
module.exports = function (app) {
9
  // API
10
  app.use('/api/customers', new CustomerController().routeAPI())
11
  app.use('/customers', new CustomerController().route())
12
  app.use('/api/prices', new PriceController().routeAPI())
13
  app.use('/api/messages', new MessageController().routeAPI())
14
15
  app.use('/auth', new AuthController().route())
16
17
  // Ordinary web pages
18
  app.get('/', function (req, res, next) {
0 ignored issues
show
Unused Code introduced by
The parameter next is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
19
    res.render('home/home', { title: 'Grogan Burner Services' })
20
  })
21
22
  // Testing Flash messages
23
  app.get('/flash', function (req, res) {
24
    req.flash('info', 'Hi there!')
25
    res.redirect('/')
26
  })
27
28
  app.get('/no-flash', function (req, res) {
29
    res.redirect('/')
30
  })
31
32
  app.get('/multiple-flash', function (req, res) {
33
    req.flash('info', ['Welcome', 'Please Enjoy'])
34
    res.redirect('/')
35
  })
36
}
37